package cn.tedu_01;

import jdk.internal.util.xml.impl.Input;

import java.io.*;

public class InputStreamTest {

    public static void main(String[] args) throws IOException {
        //method();
        method2();


    }

    private static void method2() throws IOException {
        InputStream in =
                new BufferedInputStream
                        (new FileInputStream("F:\\baby\\测试1.txt"));
        int b = 0;
        while((b=in.read()) !=-1){
            System.out.println(b);
        }
        in.close();
    }

    private static void method() throws IOException {
        InputStream in =
                new FileInputStream("F:\\baby\\测试1.txt");
        int data =in.read();
        System.out.println(data);
        int data2 =in.read();
        System.out.println(data2);

        int b = 0;
        while(( b = in.read() ) != -1){
            System.out.println(b);
        }
        in.close();
    }
}
